﻿package gui.hug;

class LightButton extends LinkButton {
	private var c : Int; // color
	private var ac : Int; // active color
	private var tc : UInt; // text color
	private var atc : UInt; // active text color
	private var align : Int;
	private var margins : UInt;

	public static inline var CENTER : UInt = 0;
	public static inline var LEFT : UInt = 1;
	public static inline var RIGHT : UInt = 2;

	public function new(label : String, x : Float, y : Float, width : Float, color : Int, active_color : Int, text_color : UInt, active_text_color : UInt, align : UInt = CENTER, font_size : UInt = 11, margins : UInt = 4) {
		//super(label, x, y, font_size, width);
		c = color;
		ac = active_color;
		tc = text_color;
		atc = active_text_color;
		this.align = align;
		this.margins = margins;
		super(label, x, y, font_size, width);
		//updateButton();
	}

	public override function updateButton() {
		if (align < 0) return;

		upState   = new LightButtonDS(bt, 0, label, fontSize, textFormat, w, c, ac, tc, atc, align, margins);
		overState = new LightButtonDS(bt, 1, label, fontSize, textFormat, w, c, ac, tc, atc, align, margins);
		downState = hitTestState = overState;
	}
}
